include ./makefile.inc

LIB_TARGET = lib/libconcurrency.a

INC_DIR= include/
SRC_DIR= src/
OBJ_DIR= obj/
LIB_DIR= lib/

OBJ_EXT= .o
CXXSRC_EXT= .cpp
CSRC_EXT= .c


SRCS = $(wildcard src/*.cpp )
SRCS1 = $(notdir $(SRCS))
OBJECTS = $(patsubst %.cpp, obj/%.o, $(SRCS1))

$(LIB_TARGET): $(OBJECTS)
	@echo
	@echo "$(OBJECTS) ==> $@"
	@$(AR) rc $(LIB_TARGET) $(OBJECTS)

$(OBJ_DIR)%$(OBJ_EXT): $(SRC_DIR)%$(CXXSRC_EXT) 
	@echo
	@echo "Compiling $< ==> $@..."
	$(CXX) $(INC) $(C_FLAGS) -c $< -o $@

all: $(LIB_TARGET) 

test:
	echo $(OBJECTS)

clean:
	find ./ -name *.o -exec rm -rf {} \;
	find ./ -name *.a -exec rm  -rf {} \;


